Don't sort the recent-items by hand
authorFederico Mena Quintero <federico@gnome.org>
Thu, 25 Aug 2011 17:57:03 +0000 (12:57 -0500)
committerFederico Mena Quintero <federico@gnome.org>
Fri, 26 Aug 2011 17:44:21 +0000 (12:44 -0500)
The mtime from GtkRecentManager may not the same as the file's actual
mtime, so the final result could appear unsorted to the user.  Instead,
we will let the view do the sorting.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
gtk/gtkfilechooserdefault.c

index d24c3c110b7ee5bf53eec68af9c71e64848f0e82..d3b95e50b66873729c6f7bb4eb11765c680eef3f 100644 (file)
@@ -9321,16 +9321,6 @@ recent_idle_cleanup (gpointer data)
   g_free (load_data);
 }
 
-static gint
-recent_sort_mru (gconstpointer a,
-                 gconstpointer b)
-{
-  GtkRecentInfo *info_a = (GtkRecentInfo *) a;
-  GtkRecentInfo *info_b = (GtkRecentInfo *) b;
-
-  return (gtk_recent_info_get_modified (info_b) - gtk_recent_info_get_modified (info_a));
-}
-
 static gint
 get_recent_files_limit (GtkWidget *widget)
 {
@@ -9421,8 +9411,6 @@ recent_idle_load (gpointer data)
   /* second iteration: MRU sorting and clamping, and populating the model */
   if (load_data->needs_sorting)
     {
-      load_data->items = g_list_sort (load_data->items, recent_sort_mru);
-
       if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN)
        populate_model_with_recent_items (impl, load_data->items);
       else